package com.skywolf.chem.utils;

import java.util.regex.Pattern;

/**
 * Created by pei_pei on 2020/6/10.
 */
public class PhoneUtils {
    /**
     * 手机号验证
     * @param phoneNo
     */
    public static Boolean phoneCheck(String phoneNo) {
        if (phoneNo == null || phoneNo.length() == 0 || !Pattern.compile("^1(3|4|5|6|7|8|9)\\d{9}$").matcher(phoneNo).matches()) {
           return false;
        }
        return true;
    }

    /**
     * 获取验证码
     * @return
     */
    public static String getCode(){
        return String.valueOf((int) (Math.random() * 9000) + 1000);
    }
}
